import { createApp } from "vue";
import App from "@/views/_Layout/_Root.vue";

//路由与存储
import router from "@/router/router";
import { createPinia } from "pinia";

//ElementPlus
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";

//图标
import * as ICons from "@element-plus/icons-vue";

//表格
import { VXE_Table } from "@/lib/vxe-table/vxe-table";
import "@/assets/css/vxe-table-var.scss";

//进度条
import nProgress from "nprogress";

//设置进度条显示时不显示loading
nProgress.configure({
    showSpinner: false,
});

//指令
import Directives from "@/_gx/Directives";

//本地样式
import "@/assets/css/index.scss";

//构建一个app对象
const app = createApp(App);

//全局注册图标
for (let name in ICons) {
    app.component(name, (ICons as any)[name]);
}

app.use(VXE_Table);
app.use(ElementPlus, { locale: zhCn });
app.use(createPinia());
app.use(router);
app.use(Directives);

app.mount("#root");
